package com.eternal.Exception;


import lombok.Data;
import org.apache.poi.ss.formula.functions.T;

/**
 * @Package com.eternal.sell.Exception
 * @Description TODO:
 * @uthor ZZ
 * @CreateTime 2018/5/5 13:31
 * @Versions V1.0
 */
@Data
public class ResultException extends RuntimeException {

    /**
     * 异常码
     */
    private String code;

    private Object data=null;

    public ResultException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    public ResultException(ResultEnum resultEnum,Object data) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
        this.data=data;
    }



    public ResultException(String code, String message) {
        super(message);
        this.code = code;
    }

    public ResultException(String message) {
        super(message);
        this.code = "-1";
    }
}
